﻿<UserControl x:Class="SilveR.Views.StatsViews.NonParametrics"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             
    xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    xmlns:dataInput="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.Input"
    xmlns:silveR="clr-namespace:SilveR.Views.StatsViews"
             
    mc:Ignorable="d"
    d:DesignHeight="361" d:DesignWidth="500">

    <UserControl.Resources>
        <silveR:EnumBoolConverter x:Key="ConvertEnum" />
    </UserControl.Resources>

    <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
        <Grid>
            <Border Margin="3,3,3,3" Style="{StaticResource MainAnalysisBorderStyle}">
                <Grid>
                    <TextBlock Text="Input" Margin="3,3,3,3" Style="{StaticResource TextBlockStyle}"/>

                    <TextBlock Text="Select dataset" Margin="8,25,3,3" Style="{StaticResource TextBlockStyle}" />
                    <ComboBox Name="cboData" Margin="95,21,3,3" ItemsSource="{Binding AvailableDataHandlers}" SelectedItem="{Binding SelectedDataHandler, Mode=TwoWay}" DisplayMemberPath="DisplayFileName" SelectionChanged="cboData_SelectionChanged" Style="{StaticResource ComboBoxStyle}" />

                    <TextBlock Text="Available variables"  Margin="8,51,3,3" Style="{StaticResource TextBlockStyle}"/>
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Height="120" Margin="8,73,3,3" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstAvailableVariables" DisplayMemberPath="ColumnName" ItemsSource="{Binding AvailableVariables, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Response"  Margin="137,51,6,6" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget AllowDrop="True" Margin="137,73,0,0" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstResponse" DisplayMemberPath="ColumnName" ItemsSource="{Binding ResponseList, Mode=TwoWay}" Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>

                    <TextBlock Text="Treatment" Margin="137,111,6,6" Style="{StaticResource TextBlockStyle}" />
                    <toolkit:ListBoxDragDropTarget Name="treatmentTarget" AllowDrop="True" Margin="137,131,6,6" DragOver="oneItem_DragOverOrDrop" Drop="oneItem_DragOverOrDrop" ItemDragCompleted="Target_ItemDragCompleted" Style="{StaticResource ListBoxDragDropTargetStyle}">
                        <ListBox Name="lstTreatment" DisplayMemberPath="ColumnName" ItemsSource="{Binding TreatmentList, Mode=TwoWay}"  Style="{StaticResource ListBoxStyle}"/>
                    </toolkit:ListBoxDragDropTarget>
                </Grid>
            </Border>

            <Border Margin="3,215,3,3" Style="{StaticResource MainAnalysisBorderStyle}">
                <Grid>
                    <TextBlock Margin="8,3,3,3" Text="Analysis" Style="{StaticResource TextBlockStyle}" />
                    <RadioButton Content="Overall test (Kruskal-Wallis &amp; Mann-Whitney)" Margin="8,25,6,6" Name="rdoKWOverallComparison" GroupName="AnalysisType" IsChecked="{Binding Path=AnalysisType, Mode=TwoWay, Converter={StaticResource ConvertEnum}, ConverterParameter=MannWhitney}" Click="rdoControl_Click" Style="{StaticResource RadioButtonStyle}"/>
                    <RadioButton Content="All treatment comparisons" Margin="8,48,6,6" Name="rdoAllTreatmentsComparison" GroupName="AnalysisType" IsChecked="{Binding Path=AnalysisType, Mode=TwoWay, Converter={StaticResource ConvertEnum}, ConverterParameter=AllComparisons}" Click="rdoControl_Click" Style="{StaticResource RadioButtonStyle}"/>
                    <RadioButton Content="Comparisons back to control" Margin="8,72,6,6" Name="rdoBackToControl" GroupName="AnalysisType" IsChecked="{Binding Path=AnalysisType, Mode=TwoWay, Converter={StaticResource ConvertEnum}, ConverterParameter=CompareToControl}" Click="rdoControl_Click" Style="{StaticResource RadioButtonStyle}"/>

                    <TextBlock Text="Significance"  Margin="309,25,0,0" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Margin="309,48,0,0" Name="cboSignificance" ItemsSource="{Binding SignificanceList}" SelectedItem="{Binding Significance, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}" />

                    <TextBlock Text="Control" Margin="309,73,0,0" Style="{StaticResource TextBlockStyle}"/>
                    <ComboBox Margin="309,92,0,0" Name="cboControl" IsEnabled="False" ItemsSource="{Binding ControlList}" SelectedItem="{Binding Control, Mode=TwoWay}" Style="{StaticResource ComboBoxStyle}"/>
                </Grid>
            </Border>
        </Grid>
    </ScrollViewer>
</UserControl>